import request from '@/utils/request'

// 查询窗口管理列表
export function listCounter(query) {
  return request({
    url: '/qbs/counter/list',
    method: 'get',
    params: query
  })
}

// 查询诊室规则列表
export function listCounterRule(query) {
  return request({
    url: '/qbs/counterRule/list',
    method: 'get',
    params: query
  })
}

// 查询诊室规则详情
export function getCounterRule(id) {
  return request({
    url: '/qbs/counterRule/' + id,
    method: 'get'
  })
}

// 新增诊室规则
export function addCounterRule(data) {
  return request({
    url: '/qbs/counterRule/save',
    method: 'post',
    data: data
  })
}

// 修改窗口管理
export function editCounterRule(data) {
  return request({
    url: '/qbs/counterRule/update',
    method: 'put',
    data: data
  })
}

// 批量修改窗口管理
export function editCounterRuleList(data) {
  return request({
    url: '/qbs/counterRule/updateList',
    method: 'put',
    data: data
  })
}

// 删除规则
export function delCounterRule(id) {
  return request({
    url: '/qbs/counterRule/remove/' + id,
    method: 'delete'
  })
}

// 查询窗口管理详细
export function getCounter(id) {
  return request({
    url: '/qbs/counter/' + id,
    method: 'get'
  })
}

// 新增窗口管理
export function addCounter(data) {
  return request({
    url: '/qbs/counter/save',
    method: 'post',
    data: data
  })
}

// 修改窗口管理
export function editCounter(data) {
  return request({
    url: '/qbs/counter/update',
    method: 'put',
    data: data
  })
}

// 更新业务缓存信息
export function updateCounterCache() {
  return request({
    url: '/qbs/counter/updateCache',
    method: 'get'
  })
}

// 删除窗口管理
export function delCounter(id) {
  return request({
    url: '/qbs/counter/remove/' + id,
    method: 'delete'
  })
}

// 导出窗口管理
export function exportCounter(query, ids) {
  return request({
    url: '/qbs/counter/export/' + ids,
    method: 'get',
    params: query
  })
}

// 修改状态
export function editCounterRuleStatus(id, counterId, status) {
  return request({
    url: '/qbs/counterRule/updateStatus/' + id + '/' + counterId + '/' + status,
    method: 'put'
  })
}
//门诊规则批量新增
export function addBatchCounterRule(data) {
  return request({
    url: `/qbs/bizinfoRule/batchSave`,
    method: 'post',
    data
  })
}
